﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <%= ViewData["scripts"] %>
    <!-- JS Custom -->
    <script type="text/javascript">
        $(document).ready(function () {
            ButtonTheme();
            $("#table").jqGrid({
                url: '/Vendedores/VendedoresList',
                datatype: 'json',
                mtype: 'GET',
                colNames: ['Código', 'Nome'],
                colModel: [
                    { name: 'COD_VEND', index: 'COD_VEND', width: 80, align: 'right' },
                    { name: 'NOME_VEND', index: 'NOME_VEND', width: 320 }
                ],
                pager: '#pager',
                width: '100%',
                height: '100%',
                rowNum: 10,
                rowList: [10, 20, 30],
                sortname: 'NOME_VEND',
                sortorder: 'asc',
                viewrecords: true,
                ondblClickRow: function (id) {
                    loadOption('/Vendedores/Details/' + id, true);
                }
            });
        });

        function New() {
            loadOption('/Vendedores/Edit', true);
        }
    </script>
</head>
<body>
    <div class="cabecalho ui-state-highlight">
        <span class="icolst" />
        <span class="txt">
            <%= Html.Encode("Cadastro de Vendedores") %>
        </span>
    </div>
    <fieldset class="container transparent">            
        <label class="input80">
            <button type="button" class="documentcommand" onclick="New()">Novo Vendedor</button>
        </label>
    </fieldset>
    <%= Html.jqGrid() %>
</body>
</html>
